package com.elong.android.specialhouse.utils;

import com.elong.android.specialhouse.R;
import com.nostra13.universalimageloader.core.DisplayImageOptions;

/**
 * @author kaiqi.li
 * @Description
 * @date 2015/9/17 15:21
 */
public class ImageLoaderUtils {

    private static DisplayImageOptions options ;

    /**
     * 房源相关图片展示options
     * @return
     */
    public static DisplayImageOptions getHouseImageOptions() {
        return getDefaultOptions(R.drawable.bg_loading_default, R.drawable.bg_loading_default) ;
    }
    
    /**
     * 头像相关图片展示options
     * @return
     */
    public static DisplayImageOptions getHeaderImageOptions() {
        return getDefaultOptions(R.drawable.default_user_photo, R.drawable.default_user_photo) ;
    }

    /**
     *
     * @param showImageForEmptyUri
     * @param showStubImage
     * @return
     */
    public static DisplayImageOptions getDefaultOptions(int showImageForEmptyUri, int showStubImage) {
        options = new DisplayImageOptions.Builder().showImageForEmptyUri(showImageForEmptyUri)
                .showStubImage(showStubImage).cacheInMemory().cacheOnDisc().build();
        return options ;
    }

    public static DisplayImageOptions.Builder getDefaultBuild() {
        return new DisplayImageOptions.Builder().showImageForEmptyUri(R.drawable.bg_loading_default)
                .showStubImage(R.drawable.bg_loading_default).cacheInMemory().cacheOnDisc();
    }
}
